//***************************************************************************
//*
//*	File:			DialogBuild.h
//*	Description:	Dialog for executing builds
//*
//***************************************************************************
//*
//*	Note:			This source code is provided "as is" meaning that you may 
//*					use it at your own risk. 
//*					You are free to use it in any way you like.
//*
//***************************************************************************
//*
//*	History:		
//*
//*	-------------------------------------------------------------------------
//*	2003/07/27	|	Initial release									|	rk
//*	-------------------------------------------------------------------------
//*
//***************************************************************************

//
//-------------------------------------------------------------- PREPROCESSOR 
//

#ifndef			__DIALOGBUILD_H_INCLUDED
#define			__DIALOGBUILD_H_INCLUDED

#if				_MSC_VER > 1000
#pragma once
#ifdef			__SWITCH_SHOW_HEADER
#pragma message ("-- DialogBuild.h\n")
#endif
#ifdef			__SWITCH_SHOW_HEADER_TREE
#pragma message ("-- "__FILE__"\n")
#endif
#endif 

//
//-------------------------------------------------------------- DEPENDENCIES
//

//
//--------------------------------------------------------- CLASS DECLARATION
//

//***************************************************************************
//**	@DOC		CLASS CDialogBuild
//***************************************************************************
//**	@CLASS		Dialog for executing builds
//**	@BASE		Dialog
//***************************************************************************
class CDialogBuild : public CDialog
{
	//																									
	//-----------------------------------------------------------------------							
	//****************************     ENUMS     ****************************
	//-----------------------------------------------------------------------							
	//																									
public:																						// @ACCESS			Public Enumerations
	enum EFinishAction																		// @CMEMBER,MENUM	Finish actions
	{																						//
		EFinishAction_Continue																// @@EMEM			Continue after all builds finished
	,	EFinishAction_Quit																	// @@EMEM			Close DevStudio after all builds finished
	,	EFinishAction_LogOff																// @@EMEM			Log off current user after all builds finished
	,	EFinishAction_PowerOff																// @@EMEM			Shut down the computer after all builds finished
	};
	
	//																									
	//-----------------------------------------------------------------------							
	//***************************     ATTRIBS     ***************************							
	//-----------------------------------------------------------------------							
	//																									
private:																					// @ACCESS	Private Attributes	
	//{{AFX_DATA(CDialogBuild)
	enum		{ IDD = IDD_BUILD }		;
	CListCtrl	m_ctrlListConfigurations;
	int			m_iMode					;
	//}}AFX_DATA

	IApplication* m_pIApplication		;													// @CMEMBER	Pointer to application's interface

public:																						// @ACCESS	Public Attributes	
	EFinishAction m_enuFinishAction		;

	//																							
	//-----------------------------------------------------------------------					
	//***************************     GET/SET     ***************************					
	//-----------------------------------------------------------------------					
	//																							
public:																						// @ACCESS	Public Get/Set Methods	
	void SetApplication	( IApplication*		a_pIApplication			)			;			// @CMEMBER	Sets the pointer to the application's interface

	//																							
	//-----------------------------------------------------------------------					
	//*************************     PERISTENCE     **************************					
	//-----------------------------------------------------------------------					
	//																							
private:																					// @ACCESS	Private Persistency Methods	
	void LoadProfile	( void )												;			// @CMEMBER	Loads profile settings from the registry
	void WriteProfile	( void )										const	;			// @CMEMBER	Saves profile settings to   the registry

	//																							
	//-----------------------------------------------------------------------					
	//**************************     EXECUTION     **************************
	//-----------------------------------------------------------------------					
	//																							
private:																					// @ACCESS	Private Execution Methods	
	BOOL Execute		( void )	;														// @CMEMBER Executes the selected configurations' build process

	//																							
	//-----------------------------------------------------------------------					
	//***************************     HELPERS     ***************************
	//-----------------------------------------------------------------------					
	//																							
private:																					// @ACCESS	Private Helper Methods	
	void AddProject		( const CString&	a_strProjectName
						, const CString&	a_strProjectPath
						, const CString&	a_strWorkspaceName
						, const CString&	a_strWorkspacePath
						, const CString&	a_strConfigurations
						,		int			a_iStyle				)			;			// @CMEMBER	Adds the specified project to the dialog
	void MoveItem		(		int			a_iSrc	
						,		int			a_iDst					)			;			// @CMEMBER	Swaps the contents of the items under source and target index

	//																							
	//-----------------------------------------------------------------------					
	//**************************     VIRTUALS     ***************************
	//-----------------------------------------------------------------------					
	//																							
	//{{AFX_VIRTUAL(CDialogBuild)
protected:																					// @ACCESS	Protected Overridables
	virtual void DoDataExchange			( CDataExchange* pDX );								// @CMEMBER	DDX/DDV Support
	//}}AFX_VIRTUAL

	//																							
	//-----------------------------------------------------------------------					
	//**************************     MESSAGES     ***************************
	//-----------------------------------------------------------------------					
	//																							
protected:																					// @ACCESS	Protected Message Handlers
	//{{AFX_MSG(CDialogBuild)
	virtual BOOL OnInitDialog			();													// @CMEMBER	Called to initialize the dialog
	virtual void OnOK					();													// @CMEMBER	Called when OK button is clicked
	afx_msg void OnMoveUp				();													// @CMEMBER	Called when MoveUp button is pressed
	afx_msg void OnMoveDown				();													// @CMEMBER	Called when MoveDown button is pressed
	afx_msg void OnClickConfigurations	( NMHDR* pNMHDR, LRESULT* pResult );				// @CMEMBER	Called when user clicks within the configurations' list control
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

public:																						// @ACCESS	Public Message Handlers
			void OnBuildFinished		( long a_lErrors, long a_lWarnings );				// @CMEMBER Called when a build has finished
	
	//																						
	//-----------------------------------------------------------------------				
	//***********************     CON/DESTRUCTION     ***********************				
	//-----------------------------------------------------------------------				
	//																						
public:																						// @ACCESS	Public Con-/Destruction Methods	
	CDialogBuild( CWnd* pParent = NULL );													// @CMEMBER	Default constructor
};

//{{AFX_INSERT_LOCATION}}

#endif // #ifndef __DIALOGBUILD_H_INCLUDED

